package com.ling.springbootinit.common;

import lombok.Data;

import java.io.Serializable;

/**
 * 通用返回类
 *
 */
@Data
public class SongCommentResponse<T,E> implements Serializable {

    private int code;

    private Boolean hasMore;
    private T hotComments;

    private E topComments;
    private int total;

    public SongCommentResponse(int code, Boolean hasMore, T hotComments, E topComments, int total) {
        this.code = code;
        this.hasMore = hasMore;
        this.hotComments = hotComments;
        this.topComments = topComments;
        this.total = total;
    }

    public SongCommentResponse(ErrorCode errorCode) {
        this(errorCode.getCode(), false,null, null,0);
    }


}
